package com.ly.mp.cmc.common.reponse;

import lombok.Data;

import java.io.Serializable;

/**
 * @Author: ly-songpengfei
 * @Date: 2025/8/3 17:36
 * @Description: 返回结果类
 * @Version:
 */
@Data
public class Result<T> implements Serializable {

    // 结果编码
    private String code;
    // 结果信息
    private String msg;
    // 结果记录
    private T rows;
    // 当前页数
    private long pageIndex;
    // 总页数
    private long pages;
    // 总记录数
    private long records;
    // 业务数据
    private String bizInfo;

    public boolean isSuccesss() {
        boolean isSuccess = false;
        if ("1".equals(this.getCode())) {
            isSuccess = true;
        }
        return isSuccess;
    }

    public boolean isError() {
        boolean isError = false;
        if (!"1".equals(this.getCode())) {
            isError = true;
        }
        return isError;
    }

}
